package svc

import (
	"github.com/zeromicro/go-zero/zrpc"
	"navi-mumbai/app/api/game/internal/config"
	gameLogin "navi-mumbai/app/rpc/game/client/gameuser"
	gameWallet "navi-mumbai/app/rpc/game/client/gamewallet"
	"navi-mumbai/app/rpc/wallet/client/walletusers"
)

type ServiceContext struct {
	Config config.Config

	WalletRpc     walletusers.WalletUsers
	GameWalletRpc gameWallet.GameWallet
	GameUserRpc   gameLogin.GameUser
}

func NewServiceContext(c config.Config) *ServiceContext {
	return &ServiceContext{
		Config:        c,
		WalletRpc:     walletusers.NewWalletUsers(zrpc.MustNewClient(c.WalletRpcConf)),
		GameWalletRpc: gameWallet.NewGameWallet(zrpc.MustNewClient(c.GameRpcConf)),
		GameUserRpc:   gameLogin.NewGameUser(zrpc.MustNewClient(c.GameRpcConf)),
	}
}
